<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="/js/jquery-1.11.0.min.js"></script>
</head>

<body>
    <script>
        $.get('http://www.liulongbin.top:3006/api/getbooks', { id: 1 }, function (res) {
            console.log(res);
        })
        // 等同于'http://www.liulongbin.top:3006/api/getbooks?id=1'
        $.ajax({
            method: 'GET',
            url: 'http://www.liulongbin.top:3006/api/getbooks',
            data: {
                name: 'pink',
                age: 20
            },
            success: function (res) {
                console.log(res);
            }
        })
        // 等同于'http://www.liulongbin.top:3006/api/getbooks?name=pink&age=20'
        
        // 无论是$get/$ajax 携带参数本质都是在url地址后面通过?拼接查询字符串的形式向服务器传递参数

        
    </script>
</body>

</html>